package com.lumlord.common.base;

import java.util.List;
import org.apache.ibatis.annotations.Param;

import com.lumlord.common.exception.BusinessException;
import com.lumlord.mapper.auto.AutoCode;
/**
 * 抽象类BaseService
* @ClassName: BaseService
* @Description: TODO(Service实现这个)
* @author gpf 
* @date 2019年9月19日 
*
 */
public interface ApiService<T,T2> {
	
    int deleteByPrimaryKey(Integer[] ids) throws BusinessException;

    int insertSelective(T record) throws BusinessException;

    T selectByPrimaryKey(Integer id) throws BusinessException;
   
    int updateByPrimaryKeySelective(T record) throws BusinessException;
    
    int updateByExampleSelective(@Param("record") T record, @Param("example") T2 example) throws BusinessException;

    int updateByExample(@Param("record") T record, @Param("example") T2 example) throws BusinessException;
    
    List<T> selectByExample(T2 example) throws BusinessException;

    long countByExample(T2 example) throws BusinessException;

    int deleteByExample(T2 example) throws BusinessException;
    
    /**
     * 逻辑删除
     * @param ids
     * @return
     */
    int del(Integer[] ids) throws BusinessException;
    
    /**
     	* 批量插入
     * @param records
     * @return
     * @throws BusinessException
     */
    public int inserBatch(List<T> records)throws BusinessException;
}

